<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./node_modules/editor.md/css/editormd.css" />
</head>

<body>
    <div id="test-editor">
        <textarea style="display: none;" class="content-markdown" name="content-markdown"></textarea>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
    <script src="./node_modules/editor.md/editormd.min.js"></script>
    <script type="text/javascript">
        $(function() {
            var editor = editormd("test-editor", {
                width: "100%", //宽度，不填为100%
                height: "500px", //高度，不填为100%
                theme: "dark", //主题,不填为默认主题
                path: "./node_modules/editor.md/lib/", //editor.md插件的lib目录地址
                saveHTMLToTextarea: true, // 保存 HTML 到 Textarea
                toolbarAutoFixed: true, //工具栏自动固定定位的开启与禁用
            });
            console.log(editor);
        });
    </script>
</body>

</html>